(In fact, this article should be written as "debugging techniques with FFT discussion + code problem method", the language is not good to write articles on tricky qaq)There are suggestions to welcome, there are omissions Welcome to add!FFT (Fast Fourier transform)/ntt (number theory transformation) is a common and practical optimization of convolution operationsBut the FFT/NTT process is not as visually ref
Today's a question, bare ntt, but I will not, so White sent 50 points.So he came to learn about NTT.The surface is very simple, do not bother to post, that is not the point I want to say.The emphasis is on NTT, also called the Fast number theory transformation.In many problems, we may encounter the polynomial multiplication problem in the mode meaning, when the traditional fast Fourier transform may not sat
The principle of rapid number theory change (NTT) is actually the same principle as the fast Fourier transform. For the Fermat prime of a shape such as m= c*2^n+1, it is assumed that its original root is G. So deceive g^ (m-1) ==1 and just (m-1) can divide 2^n. So the NTT transform can be performed in the modulo p field. The rotation factor is g^ ((m-1)/n). The other principles are the same as the FFT princ
Pick http://blog.csdn.net/coldef/article/details/57908865
Last time to do a set of simulation game, which need to ask the natural number k power and, then I will only n^2 ... I remember N^2 has 20 points, Nlogn can burst to 90 points ...--鏼 鏼 鏼 2015 national team paper
It's probably just this polynomial to get the inverse, find the generating function.This is O (NLOGN) O (n\log N), but the modulus of this problem is not the prime number that satisfies the requirements of
NTT can easily explode int
First to find the original root of the program (it seems that the original root of the NTT are 3)Code
#include
NTT: (prime numbers are random, generally speaking, the original number of prime numbers is 3, but for the sake of insurance recommended to call a Huangen program)
#include
The first time you cut NTT, feel that NTT is the model version of the FFT, specifically can see http://blog.csdn.net/acdreamers/article/details/39026505 speak very clearly
And then the coefficients can be preprocessed out, the time can be reduced a lot, but I am the template for the brevity or in the thinking of coefficients.
Said so much nonsense, the following we get to the point: the topic of the simples
At about on January 26, May 15, NTT was deployed in 14 prefectures in the East Japan region, all NTT flets optical fiber networks and IP Phones using optical fiber networks are suddenly unavailable. In Japan, where IP phones are widely used to replace traditional phones, this is a very serious accident. Nearly 3 million of network users and 0.6 million of IP phone users are affected. After urgent repairs by
Problem phenomenon:LoadRunner comes with test samples, travel agency ticket reservation system HP Web tours hereinafter referred to as Web tours.1, LoadRunner Program of the sample directory without web and Web tours service startup items, how to do?2, LoadRunner with the Web test sample Web tours can not open or error
NTT
Aw, it's simple.
The FFT F-F-T FFT can be accelerated due to the good nature of having the primary n units root wn=e2πin w n = e 2πi n w_n=e^{\frac{2\pi i}{n}}. In the natural number field, modulo p p p, the WN w n w_n can be replaced with gp−1n g p−1 n G^{\frac{p-1}{n}}, G G g is the root of P p p, it can be found that those properties are similar. The inverse transformation also converts gp−1n g p−1 n G^{\frac{p-1}{n}} to g−p−1n g−p−1 n g^{-\f
combined number and the number. N, K, a []
Ideas:Consider it as a polynomial of 1000000 items. If a [] = x exists, the coefficient of X is 1, and then the polynomial is automatically multiplied K times. The part with the coefficient not 0 indicates that K numbers can exist, you can use FFT + quick power. To avoid precision errors, change non-zero values to 1 after each quick power to avoid errors after it becomes very large, complexity O (1000000 * log000000 * logk), which is a little large. T
[C language exploration tour] Part 1 Lesson 10: Exercise questions + exercises, study tours
Introduction
1. Course outline
2. Part 1 Lesson 10: exercise + exercise
3. Part 2 Lesson 1: Modular programming
Course outline
Our courses are divided into four parts. Each part has exercise questions after completion and answers will be published. Three games will also be written in C language.
Basic knowledge of C Programming
What is programming?
To
[C language exploration tour] Part 2 Lesson 10: Exercise questions and exercises, study tours
Introduction
1. Course outline
2. Part 2 Lesson 11th: Exercise questions and exercises
3. Part 3 Lesson 1 notice: Install SDL
Course outline
Our courses are divided into four parts. Each part has exercise questions after completion and answers will be published. Three games will also be written in C language.
Basic knowledge of C Programming
What is
Test instructions is to give a diagram that is not connected, and then define a diameter: the distance between two points of the shortest distance in the Unicom component.To connect the two connected components in an disconnected graph, the new component can be generated with a minimum diameter, and the new diameter is output.The idea is to use Floyd to find the shortest distance between any two points, and then find the distance from each point to the farthest point of the component at which th
ApplicationProgramMercury tours is a Web-based travel agent system. Mercury tours users can connect to the Web server, search for flights, book flights, and view flight routes.LoadRunner supports more than 40 types of applications, and Mercury tours is a LoadRunner example system. Generally, we use mercury tours to lea
I will NTT. It's fake. I will be polynomial to inverse. It's fake. I can count Sterling. It's fake.
The official explanation is Cdq+ntt or polynomial inversion, but I'm not GG.Fortunately there is a kind of direct NTT, to kneel Orz
ANS=∑I=0N∑J=0ISI,JX2JX (j!) Ans=\sum\limits_{i=0}^n\sum\limits_{j=0}^is_{i,j}\times2^j\times (j!)SI,J=1J!∑K=0J (−1) kckj (j−k) I s_
Travelling tourstime limit:1.0 SecondMemory limit:64 Mbthere isNCities numbered from 1 toN(1≤N≤200) andMTwo-way roads connect them. There is at the most one road between and cities. In summer holiday, members of the DSAP Group want to make some traveling tours. Each tour is a route passesKDifferent cities (K> 2)T1,T2,...,TKand return toT1. Your task is to help them makeTTours such that:
Each of the These T
\webtours Start Xigui32.exe③ Restart Service: Start->loadrunner->samples->web->start Web Server④ refreshing the browserResult: The page has only the table header, the bottom blankGuess the reason 3:strawberry was mistakenly deletedProcessing: Strawberry-perl-5.10.1.0.msi Reinstall, service restart,The result: still can't go upGuess cause 4: Installation ErrorProcess: Reinstall LoadRunner 11① Make sure the LoadRunner is installed in the default machine directory② ensure that the HP Web
Problem:LoadRunner The HP Web Tours Application service does not start, prompting 1080 port to be occupiedWith internal Error:your request was unsuccessful cannot create GUI Process-program not foundCheck method:1. View processes that occupy 1080 ports2. Check if there is a strawberry folder under the C drive, if you do not need to download Strawberry-perl-5.10.1.0.msi and install, and then refresh the browser can see the program opened successfullyWo
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.